import React, {useState} from "react";
import MRouter from "./router/IndexRouter"
import Tabbar from "./components/Tabbar";
import "./views/css/App.css"
import store from "./redux/store";

export default function App() {
    const [state, setState] = useState(store.getState().TabbarReducer.isShow);

    // 订阅store 通过getState().isShow来判断是否隐藏Tabbar
    store.subscribe(() => {
        setState(store.getState().TabbarReducer.isShow);
    })

    return <div>
        <MRouter>
            {state && <Tabbar />}
        </MRouter>
    </div>
}